home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / docs / Eiffel.doc < prev    next >
Encoding:
Text File  |  1995-12-27  |  34.0 KB  |  1,048 lines

  1.  
  2.  
  3. Eiffel V3.0 language reference
  4.  
  5. This is Eiffel V3.0 language reference and can be used pressing  Browse >
  6. button or in conjunction with AmigaGuide capabilities of an Eiffel compiler or
  7. interpreter, providing complete and precise error report. The high formalism
  8. degree of this document is part of Eiffel's challenge of software reliability.
  9.  
  10. All Eiffel3.0-related syntax and validity are described here even if not
  11. implemented in CoolDemo. Thus this document serves as an ideal that Cool must
  12. reach.
  13.  
  14.  
  15. Eiffel V3.0 syntax specification
  16.  
  17. This is Eiffel syntax reference and can be used pressing  Browse >  button or
  18. in conjunction with AmigaGuide capabilities of an Eiffel compiler or
  19. interpreter, providing complete and precise error report. The syntactical
  20. correction is the first level of valididity requirements for any Eiffel
  21. structured document. Processing tools may claim supplememtary requirements on
  22. a well-formed specimem of a construct. Such requirements are meaningless while
  23. the construct is not built according to the following rules.
  24.  
  25.  
  26. Class_declaration ::= [ Indexing ]
  27.                       Class_header
  28.                       [ Formal_generics ]
  29.                       [Obsolete]
  30.                       [ Inheritance ]
  31.                       [Creators]
  32.                       [ Features ]
  33.                       [ Invariant ]
  34.                       end ["--" class Class_name]
  35.  
  36. Class_header ::= [Header_mark] class Class_name
  37. Header_mark  ::= deferred | expanded
  38. Class_name   ::= Identifier
  39.  
  40. Creators ::= creation {Creation_clause creation ..."}+
  41. Creation_clause ::= [Clients ] [ Header_comment ] Feature_list
  42.  
  43. Obsolete ::= obsolete Message
  44. Message  ::= Manifest_string
  45.  
  46. Indexing     ::= indexing Index_list
  47. Index_list   ::= {Index_clause ";" ..."}
  48. Index_clause ::= [Index] Index_terms
  49. Index        ::= Identifier ":"
  50. Index_terms  ::= {Index_value "," ..."}+
  51. Index_value  ::= Identifier | Manifest_constant
  52.  
  53. Formal_generics ::= "[" Formal_generics_list "]"
  54. Formal_generic_list ::= {Formal_generic "," ..."}
  55. Formal_generic ::= Formal_generic_name [Constraint]
  56. Formal_generic_name ::= Identifier
  57. Constraint ::= "->" Class_type
  58.  
  59. Inheritance  ::= inherit Parent_list
  60. Parent_list ::= {Parent ";" ..."}
  61. Parent ::= Class_type [Feature_adaptation]
  62. Feature_adaptation ::= [Rename]
  63.                        [New_exports]
  64.                        [Undefine]
  65.                        [Redefine]
  66.                        [Select]
  67.                        end
  68.  
  69. Rename ::= rename Rename_list
  70. Rename_list ::= {Rename_pair "," ..."}
  71. Rename_pair ::= Feature_name as as Feature_name
  72.  
  73. New_exports ::= export New_export_list
  74. New_export_list ::= {New_export_item ";" ..."}
  75. New_export_item ::= Clients Feature_set
  76. Feature_set ::= Feature_list | all
  77. Feature_list ::= { Feature_name "," ..."}
  78.  
  79. Undefine ::= undefine Feature_list
  80. Redefine ::= redefine Feature_list
  81. Select ::= select Feature_list
  82.  
  83. Features ::= feature {Feature_clause feature ..."}
  84. Feature_clause ::= [Clients ]
  85.                    [Header_comment]
  86.                    Feature_declaration_list
  87. Feature_declaration_list ::= {Feature_declaration ";" ..."}
  88. Header_comment ::= Comment
  89. Feature_declaration ::= New_feature_list Declaration_body
  90. Declaration_body ::= [Formal_arguments]
  91.                      [ Type_mark ]
  92.                      [Constant_or_routine]
  93. Constant_or_routine ::= is Feature_value
  94. Feature_value ::= Manifest_constant | Unique | Routine
  95. New_feature_list ::= {New_feature "," ..."}+
  96. New_feature ::= [frozen] Feature_name
  97. Unique ::= unique Unique ::= unique
  98.  
  99. Clients ::= "{" Class_list "}"
  100. Class_list ::= { Class_name "," ..."}
  101.  
  102. Feature_name ::= Identifier | Prefix | infix
  103. Prefix ::= prefix '"' Prefix_operator '"'
  104. Infix ::= infix '"' Infix_operator '"'
  105. Prefix_operator ::= Unary | Free_operator
  106. Infix_operator ::= Binary | Free_operator
  107.  
  108. Routine ::= [ Obsolete ]
  109.             [Header_comment]
  110.             [ Precondition ]
  111.             [ Local_declarations ]
  112.             Routine_body
  113.             [ Postcondition ]
  114.             [Rescue]
  115.             end ["--" Feature_name ]
  116. Routine_body ::= Effective | Deferred
  117. Effective ::= Internal | External
  118. Internal ::= Routine_mark Compound
  119. Routine_mark ::= do | once
  120. Deferred ::= deferred
  121. Rescue ::= rescue Compound
  122.  
  123. Precondition ::= require [else] Assertion
  124. Postcondition ::= ensure [then] Assertion
  125. Variant ::= variant [Tag_mark] Integer_expression
  126. Invariant ::= invariant Assertion
  127. Assertion ::= {Assertion_clause ";" ..."}
  128. Assertion_clause ::= [Tag_mark] Unlabeled_assertion_clause
  129. Unlabeled_assertion_clause ::= Boolean_expression | Comment
  130. Tag_mark ::= Tag ":" Tag ::= Identifier
  131.  
  132. Compound ::= {Instruction ";" ..."}
  133.  
  134. Instruction ::= Creation |
  135.                 Call |
  136.                 Assignment |
  137.                 Reverse_assignment_attempt |
  138.                 Conditional |
  139.                 Multi_branch |
  140.                 Loop |
  141.                 Debug |
  142.                 Check |
  143.                 Retry
  144.  
  145. Creation ::= "!" [ Type ] "!" Writable [Creation_call]
  146. Creation_call ::= "." Unqualified_call
  147.  
  148. Assignment ::= Writable ":=" Expression
  149. Reverse_assignment_attempt ::= Writable "?=" Expression
  150. Check ::= check Assertion end
  151. Retry ::= retry "?=" Expression
  152. Check ::= check Assertion end
  153. Retry ::= retry
  154.  
  155. Conditional ::= if Then_part_list [Else_part] end
  156. Then_part_list ::= {Then_part elseif ..."}+
  157. Then_part ::= Boolean_expression then then Compound
  158. Else_part ::= else Compound
  159.  
  160.  
  161. Multi_branch ::= inspect Expression [When_part_list] [Else_part] end
  162. When_part_list ::= when {When_part when ..."}+
  163. When_part ::= Choices then Compound
  164. Choices ::= {Choice "," ..."}
  165. Choice ::= Constant | Interval
  166. Interval ::= Integer_interval | Character_interval
  167. Integer_interval ::= Integer_constant ".." Integer_constant
  168. Character_interval ::= Character_constant ".." Character_constant
  169.  
  170. Loop ::= Initialization
  171.          [ Invariant ]
  172.          [ Variant ]
  173.          [Loop_body]
  174.          end
  175. Initialization ::= from Compound
  176. Loop_body ::= Exit loop Compound
  177. Exit ::= until Boolean_expression
  178.  
  179. Debug ::= debug [Debug_keys] Compound end end
  180. Debug_keys ::= "(" Debug_key_list ")"
  181. Debug_key_list ::= {Debug_key "," ..."}
  182. Debug_key ::= Manifest_string
  183.  
  184. Call ::= [Parenthesized_qualifier] Call_chain
  185. Parenthesized_qualifier ::= Parenthesized "."
  186. Call_chain ::= {Unqualified_call "." ..."}+
  187. Unqualified_call ::= Identifier [Actuals]
  188. Actuals ::= "(" Actual_list ")"
  189. Actual_list ::= {Actual "," ..."}
  190. Actual ::= Expression | Address
  191. Address ::= "$" Identifier
  192.  
  193. Integer_expression ::= Expression
  194. Boolean_expression ::= Expression
  195.  
  196. Expression ::= Call |
  197.                Operator_expression |
  198.                Equality |
  199.                Constant |
  200.                Local |
  201.                Read_only |
  202.                Manifest_array |
  203.                Old |
  204.                Strip
  205.  
  206. Equality ::= Expression Comparison Expression
  207. Comparison ::= "=" | "/="
  208. Constant ::= Manifest_constant | Constant_attribute
  209. Constant_attribute ::= Identifier
  210. Old ::= old Expression
  211. Strip ::= strip "(" Attribut_list ")"
  212. Atrribute_list ::= {Identifier "," ..."}
  213. Operator_expression ::= Parenthesized |
  214.                         Unary_expression |
  215.                         Binay_expression
  216. Parenthesized ::= "(" Expression ")"
  217. Unary_expression ::= Unary Expression
  218. Binary_expression ::= Binary Expression
  219.  
  220. Unary ::= not | "+" | "-" Binary ::= "+" | "-" | "*" | "/" |
  221.           "<" | ">" | "<=" | ">=" |
  222.           "//" | "\" | "^" |
  223.           and | or | xor |
  224.           and then | or else | implies
  225.  
  226. Formal_arguments ::="(" Entity_declaration_list ")"
  227. Local_declarations ::= local Entity_declaration_list
  228. Entity_declaration_list ::= {Entity_declaration_group ";" ..."}
  229. Entity_declaration_group ::= Identifier_list Type_mark
  230. Identifier_list ::= {Identifier "," ..."}+
  231. Type_mark ::= ":" Type
  232.  
  233. Entity ::= Writable | Read_only
  234. Writable ::= Attribute | Local
  235. Attribute ::= Identifier
  236. Local ::= Identifier | Result
  237. Read_only ::= Formal | Current
  238. Formal ::= Identifier
  239.  
  240. Manifest_array ::= "<<" Expression_list ">>"
  241. Expression_list ::= { Expression "," ..."}
  242.  
  243. Manifest_constant ::= Boolean_constant | Character_constant |
  244.                       Integer_constant | Real_constant |
  245.                       Manifest_string | Bit_constant
  246. Sign ::= "+" | "-"
  247. Integer_constant ::= [Sign] Integer
  248. Character_constant ::= "'" Character "'"
  249. Boolean_constant ::= true | false
  250. Real_constant ::= [Sign] Real
  251. Manifest_string ::= '"' Simple_string '"'
  252. Bit_constant ::= Bit_sequence
  253.  
  254. Type ::= Class_type |
  255.          Class_type_expanded |
  256.          Formal_generic_name |
  257.          Anchored |
  258.          Bit_type
  259. Class_type ::= Class_name [Actual_generics]
  260. Actual_generics ::= "[" type_list "]"
  261. Type_list ::= {Type "," ..."}
  262. Class_type_expanded ::= expanded Class_type
  263. Bit_type ::= BIT Constant
  264. Anchored ::= like Anchor
  265. Anchor ::= Identifier | Current
  266.  
  267. External ::= external Language_name [External_name]
  268. Language_name ::= Manifest_string
  269. External_name ::= alias
  270. External_name ::= alias Manifest_string
  271.  
  272. Comment ::= "--" {Simple_string Comment_break ..."}
  273. Comment_break ::= New_line [Blanks_or_tabs] "--"
  274.  
  275.  
  276. Validity constraints of Eiffel language V3.0
  277.  
  278. This is validity reference and can be used pressing  Browse >  button or in
  279. conjunction with AmigaGuide capabilities of an Eiffel compiler or interpreter,
  280. providing complete and precise error report. Validity is the second and last
  281. level of requirements for any Eiffel structured document. Any valid
  282. construction can be processed by an Eiffel compiler or interpreter. Validity
  283. requirements are meaningless while the construct is not built according to the
  284. syntax rules.
  285.  
  286.  
  287. VAOL, Chapter 9.9
  288.  
  289. An Old expression of the form old e, where e is an expression of type TE,
  290. is valid if and only if it satisfies the following two conditions:
  291. 1. It appears in a Postcondition clause of a Routine r.
  292. 2. Transforming r into a function with result type TE (by adding a result
  293.    type if r is a procedure, or changing its result type if it is already a
  294.    function) and replacing its entire Routine part by
  295.      do
  296.        Result  := e
  297.      end
  298.    would yield a valid routine.
  299.  
  300.  
  301. VAPE, Chapter 9.8
  302.  
  303. A Precondition of a routine r of a class C is valid if and only if every
  304. feature whose final name appears in any Assertion_clause is available to every
  305. class to which r  is available.
  306.  
  307.  
  308. VAVE, Chapter 9.14
  309.  
  310. A variant is valid if and only if it is an expression of type INTEGER .
  311.  
  312.  
  313. VBAR, Chapter 2.6
  314.  
  315. Assignment rule
  316.  
  317. An assignment is valid if and only if its source expression conforms to its
  318. target entity.
  319.  
  320.  
  321. VBGV, Chapter 2.7
  322.  
  323. General Validity rule
  324.  
  325. Every validity constraint relative to a construct is considered to include an
  326. implicit supplementary condition stating that every component of the construct
  327. statisfies every validity constraint applicable to the component.
  328.  
  329.  
  330. VCCH, Chapter 4.8
  331.  
  332. A Class_header appearing in the text of a class C is valid if and only if it
  333. satisfies either of the following two conditions:
  334. 1. There is no Header_mark of the deferred form and C is effective.
  335. 2. There is a Header_mark of the deferred form and C is deferred.
  336.  
  337.  
  338. VCFG, Chapter 4.9
  339.  
  340. A Formal_generics part of a Class_declaration is valid if and only if every
  341. Formal_generic_name G  appearing in it satisfies the following two conditions:
  342. 1. G  is different from the name of any class in the surrounding universe.
  343. 2. G  is different from any other Formal_generic_name appearing in the same
  344.    Formal_generics_part.
  345.  
  346.  
  347. VCRN, Chapter 4.11
  348.  
  349. If present, this comment must repeat the Class_name given at the head of the
  350. class.
  351.  
  352.  
  353. VDCN, Chapter D.5
  354.  
  355. A consistency condition applies to names used in an Ace: the Cluster_name must
  356. be unique for each cluster. It is valid, however, to use the same identifier
  357. in two or more of the role of Cluster_name, System_name, Class_name.
  358.  
  359.  
  360. VDJR, Chapter 10.23
  361.  
  362. Join rule
  363.  
  364. It is valid for a class C to inherit two different features as deferred under
  365. the same final name if and only if, after possible redeclaration in C, they
  366. have identical signatures.
  367.  
  368.  
  369. VDOC, Chapter D.11
  370.  
  371. A Target_list may only appear in an Option paragraph, not in a Defaults
  372. paragraph. A System_tag may only appear in an Ace-level Defaults clause.
  373.  
  374.  
  375. VDRD, Chapter 10.22
  376.  
  377. Redeclaration rule
  378.  
  379. Let C be a class and g  a feature of C. It is valid for g  to be a
  380. redeclaration of a feature f  inherited from a parent B of C if and only if
  381. the following conditions are satisfied:
  382. 1. No effective feature of C other than f and g has the same final name as f
  383.    and g.
  384. 2. The signature of g conforms to the signature of f.
  385. 3. If g is a routine, its Precondition, if any, begins with require else (not
  386.    just require), and its Postcondition, if any, begins with 'ensure then'
  387.    (not just ensure).
  388. 4. If the redeclaration is a redefinition (rather than an effecting) the
  389.    Redefine subclause of the Parent part of B lists the final name of f in its
  390.    Feature_list.
  391. 5. If f is inherited as effective, then g is also effective.
  392. 6. If f is an attribute, g is an attribute,
  393.    f and g are both variable and their type are both expanded or both non
  394.    expanded.
  395. 7. If one from f or g is an External routine, then the other too.
  396.  
  397.  
  398. VDRS, Chapter 10.19
  399.  
  400. Redefine Subclause rule
  401.  
  402. Consider a class C with a parent B . If a Parent part for B in C contains a
  403. Redefine subclause, that clause is valid if and only if every Feature_identifier
  404. fname  that it lists (in its Feature_list) satisfies the following conditions:
  405. 1. fname  is the final name in C of a feature inherited from B.
  406. 2. That feature was not frozen, and was not a constant attribute.
  407. 3. fname  appears only once in the Feature_list.
  408. 4. The Features part of C contains one Feature_declaration for fname, which
  409.    is a valid redeclaration, but not an effecting, of the original feature.
  410.  
  411.  
  412. VDUC, Chapter D.8
  413.  
  414. The Cluster_properties part contained in a Use file may not itself contain a
  415. Use paragraph.
  416.  
  417.  
  418. VDUS, Chapter 10.19
  419.  
  420. Undefine Subclause rule
  421.  
  422. Consider a class C that inherits from a class B. If a Parent part for B in C
  423. contains an Undefine subclause, that clause is valid if and only if, for every
  424. Feature_identifier fname that it lists (in its Feature_list):
  425. 1. fname is the final name in C of a feature inherited from B.
  426. 2. That feature was not frozen, and was not an attribute.
  427. 3. That feature was effective in B.
  428. 4. fname appears only once in the Feature_list.
  429.  
  430.  
  431. VEEN, Chapter 17.9
  432.  
  433. An occurence of an entity e  in text of a class C is valid if and only if
  434. it satisfies one of the following conditions:
  435. 1.  e is the final name of an attribute of C.
  436. 2A. The occurence is in a Local_declarations, Routine_boby, Postcondition or
  437.     Rescue part of a Routine text for a function, and e is the local entity
  438.     Result.
  439. 2B. The occurence is in a Local_declarations, Routine_boby or Rescue part of a
  440.     Routine text for a routine r, and the Local_declarations part for r
  441.     contains an Entity_declaration_list including e as part of its
  442.     Identifier_list.
  443. 3.  The occurence is in a Feature_declaration for a routine r, and the
  444.     Formal_arguments part for r contains an Entity_declaration_list including
  445.     e as part of its Identifier_list.
  446. 4.  e is Current.
  447.  
  448.  
  449. VFFD, Chapter 5.14
  450.  
  451. Feature declaration rule
  452.  
  453. A Feature_declaration appearing in a class C, and whose New_feature_list
  454. contains one or more feature names F1,..,Fn is valid if and only if it
  455. satisfies all of the following conditions:
  456. 1. Its Declaration_body describes a feature which, according to the rules
  457.    of 5.11, is one of: variable attribute, constant attribute, procedure,
  458.    function.
  459. 2. None of the Fi has the same name as another faeture introduced in C
  460.    (in particular Fi is not the same name as Fj for different i and j).
  461. 3. If the name of any of the Fi is the same as the final name of any
  462.    inherited feature, the Declaration_body satisfies the Redeclaration rule.
  463. 4. If the Declaration_body describes a deferred feature, then none of the
  464.    Fi is preceded by the keyword 'frozen'.
  465. 5. If any of the Fi is a Prefix name, the Declaration_body describes an
  466.    attribute or a function with no argument.
  467. 6. If any of the Fi is an Infix name, the Declaration_body describes a
  468.    function with exactly one argument.
  469. 7. If the Declaration_body describes a once function, the result type is not
  470.    a Formal_generic_name.
  471.  
  472.  
  473. VGCC, Chapter 18.9
  474.  
  475. Creation Instruction rule
  476.  
  477. Consider a Creation instruction appearing in a class X. Let x be the
  478. target of the instruction and T a type of base class C.
  479.  
  480. The instruction is C-valid if and only if it satisfies the following
  481. conditions:
  482. 1. T is not a Formal_generic_name (that is to say, a formal parameter of the
  483.    class where the instruction appears).
  484. 2. C is an effective class.
  485. 3. If the Type part is present, the type that it contains (which is T) conforms
  486.    to the type of x, and is a reference type.
  487. 4. If C does not have a Creators part, there is no Creation_call part.
  488. 5. If C has a Creator part, there is a Creation_call part, and the call would
  489.    be A-valid if it appeared in the text of C.
  490. 6. If case 5 holds and f  is the feature of the Creation_call, then f is a
  491.    procedure, its Routine_body is not of the once... form, and f  is available
  492.    for creation to X.
  493.  
  494.  
  495. VGCI, Chapter 18.10
  496.  
  497. A Creation instruction is valid if and only if it is both C-valid and S-valid.
  498.  
  499.  
  500. VGCP, Chapter 18.8
  501.  
  502. Creation_clause rule
  503.  
  504. A Creation_clause appearing in the Creators part of a class C is valid if and
  505. only if it satisfies the following four conditions, the last three for every
  506. Feature_identifier fname in the clause's Feature_list:
  507. 1. C is effective.
  508. 2. fname is the final name of a procedure of C.
  509. 3. fname appears only once in the Feature_list.
  510. 4. If C is expanded, that procedure has no arguments, and no other
  511.    Feature_identifier appears in the Feature_list.
  512.  
  513.  
  514. VGCS, Chapter 18.10
  515.  
  516. A Creation instruction is S-valid (system-valid) if and only if it satisfies
  517. one of the following two conditions:
  518. 1. The creation type is explicit (in other words, the instruction begins with
  519.    !T !... for some type T).
  520. 2. The creation type is implicit (in other words, the instruction begins with
  521.    !!...) and every possible dynamic type T for x, with base class C, satisfies
  522.    conditions 1 to 6 of the Creation Instruction rule. In applying conditions
  523.    5 and 6, the feature of the call, f, must be replaced by its version in C.
  524.  
  525.  
  526. VHAY, Chapter 6.15
  527.  
  528. Wether you use the default ANY or another one, any system will need to have a
  529. class of name ANY . This is a constraint on any valid universe.
  530.  
  531.  
  532. VHPR, Chapter 6.6
  533.  
  534. Parent rule
  535.  
  536. The Inheritance clause of a class D is valid if and only if it meets the
  537. following two conditions:
  538. 1. In every Parent clause for a class B, B is not a descendant of D.
  539. 2. If two or more Parent clauses are for classes which have a common ancestor
  540.    A, D meets the conditions of the Repeated Inheritance Consistency constraint
  541.    for A.
  542.  
  543.  
  544. VHRC, Chapter 6.9
  545.  
  546. Rename Clause rule
  547.  
  548. It is valid to use old_name  as first element of a Rename_pair,  appearing in
  549. the Rename subclause of the Parent clause for B in a class C, if and only if
  550. the following two conditions are satisfied:
  551. 1. old_name  is the final name of a feature of B.
  552. 2. old_name  does not appear as the first element of any other Rename_pair in
  553.    the same Rename subclause.
  554.  
  555.  
  556. VIRW, Chapter 25.9
  557.  
  558.  
  559. An identifier is valid if and only if it is not one of the language's reserved
  560. words.
  561.  
  562.  
  563. VJAR, Chapter 20.4
  564.  
  565. Assignment rule
  566.  
  567. An assignment is valid if and only if its source expression conforms to its
  568. target entity.
  569.  
  570.  
  571. VJRV, Chapter 20.14
  572.  
  573. Reverse Assignment Attempt rule
  574.  
  575. A Reverse_assignment_attempt is valid if and only if the type of its target
  576. entity conforms to the type of its source expression.
  577.  
  578.  
  579. VKCN, Chapter 21.3
  580.  
  581. Whether a particular call is an instruction or a function depends on the
  582. nature of the feature of the call:
  583. 1. If the feature is an attribute or a function, the Call is syntactically an
  584.    expression.
  585. 2. If the feature is a procedure, the Call is an instruction.
  586.  
  587.  
  588. VLCP, Chapter 7.13
  589.  
  590. A Clients part is valid if and only if every Class_name appearing in its
  591. Class_list is the name of a class in the surrounding universe.
  592.  
  593.  
  594. VLEC, Chapter 7.5
  595.  
  596. Expanded Client rule
  597.  
  598. It is valid for a class C to be an expanded client a class SC if and only if SC
  599. is not a direct or indirect expanded client of C.
  600.  
  601.  
  602. VLEL, Chapter 7.13
  603.  
  604. Export List rule
  605.  
  606. A New_exports clause appearing in class C in a Parent clause for a parent B,
  607. of the form
  608.  
  609. export
  610.   {'class list' 1"}   'feature_list' 1;
  611.   ...
  612.   {'class list' 'n'"} 'feature_list' 'n';
  613.  
  614. is valid if and only if (for 'i' in the interval 1..'n'):
  615.  
  616. 1. At most one of the 'feature_list'i is the keyword 'all'.
  617. 2. All the other 'feature_list' 'i' are lists of final names of features of C
  618.    obtained from B .
  619. 3. No final feature name appears twice in any such list, or apppears in more
  620.    than one list.
  621.  
  622.  
  623. VMCN, Chapter 11.11
  624.  
  625. 1. A class may not introduce two different features, both deferred or both
  626.    effective, with the same name.
  627. 2. If a class introduces a feature with the same name as a feature it inherits
  628.    in effective form, it must rename the inherited version.
  629. 3. If a class inherits two features as effective from different parents and
  630.    they have the same name, the class must also (except under sharing for
  631.    repeated inheritance) remove the name clash through renaming.
  632.  
  633.  
  634. VMFN, Chapter 11.11
  635.  
  636. Feature name rule
  637.  
  638. It is valid for a class C to introduce a feature with the Feature_identifier
  639. fname, or to inherit a feature under the final name fname, if and only if no
  640. other feature of C has that same name.
  641.  
  642.  
  643. VMRC, Chapter 11.13
  644.  
  645. It is valid for a class D to be a repeated descendant of a class A if and only
  646. if D satisfies the following two conditions for every feature f of A:
  647. 1. If the Repeated Inheritance rule implies that f wil be shared in D, then
  648.    all the inherited versions of f are the same feature.
  649. 2. If the Repeated Inheritance rule implies that f wil be replicated in D and
  650.    f is potencially ambiguous, then the Select subclause of exactly one of the
  651.    Parent parts of D lists the corresponding version of f, under its final
  652.    name in D .
  653.  
  654.  
  655. VMSS, Chapter 11.13
  656.  
  657. Select Subclause rule
  658.  
  659. A Select subclause appearing in the Parent part for a class B in a class D is
  660. valid if and only if, for every Feature_identifier fname in its Feature_list,
  661. fname is the final name in D of a feature that has two or more potential
  662. versions in D, and fname appears only once in the Feature_list.
  663.  
  664.  
  665. VNCB, Chapter 13.11
  666.  
  667. The possible conformance cases involving a Bit_type are the following:
  668. 1. 'BIT N' conforms to 'BIT P' for N<=P.
  669. 2. For every type T  which is not a Bit_type, there is an integer bit_size(t)
  670.    such that T  conforms to 'BIT N' if and only if bit_size (t)<=N. The value
  671.    of bit_size (t) is platform-dependent.
  672.  
  673. Other than implied by these rules, no type conforms directly to a Bit_type,
  674. and a Bit_type conforms directly to no type.
  675.  
  676.  
  677. VNCC, Chapter 13.4
  678.  
  679. General Conformance
  680.  
  681. Let T and V be two types other than Bit_type. V  conforms to T  if and only if
  682. one of the following holds:
  683. 1. V and T are identical.
  684. 2. V is 'NONE' and T is a reference type.
  685. 3. V is B[Y1,..Yn] for some generic class B, T is B[X1,..,Xn], and every one of
  686.    the Yi conforms (recursively) to the corresponding Xi.
  687. 4. T is a reference type and, for some type U, V conforms directly to U and U
  688.    conforms (recursively) to T.
  689.  
  690.  
  691. VNCE, Chapter 13.10
  692.  
  693. Direct Conformance (Expanded Types)
  694.  
  695. Let T be an Expanded type. Then:
  696. 1. If the base type BT of T is a reference type, BT conforms directly to T and
  697.    T conforms directly to BT .
  698. 2. If T is INTEGER , if conforms directly to REAL and DOUBLE, and if T is REAL
  699.    it conforms directly to DOUBLE.
  700.  
  701. Other than implied by these cases, no type conforms directly to T, and T
  702. conforms directly to no type.
  703.  
  704.  
  705. VNCF, Chapter 13.7
  706.  
  707. Direct Conformance (Formal Generic)
  708.  
  709. Let G be a generic parameter of a class, which in the class may be used as a
  710. type of the Formal_generic_name category. No type conforms directly to G. If G
  711. is not constrained, it conforms directly to the type ANY (based on the
  712. corresponding universal class) and to no other type. If G is constrained by CT,
  713. G conforms directly to CT and to no other type.
  714.  
  715.  
  716. VNCG, Chapter 13.6
  717.  
  718. Direct Conformance (Generic Substitution)
  719.  
  720. Let BT  be a generically derived type of base type B [X 1,...X n] for
  721. some n>=1, where the formal generic parameters of B  are G 1,...G n.
  722. Let CT  be a type of base class C  different from B . To determine
  723. whether CT  conforms directly to BT , define the substitution ð as follows:
  724. . If CT  is non-generic, ð is the identity substitution.
  725. . If CT  is a generically derived type, of the form C ['Y'1,...'Y'm], and
  726.   class C  is declared with formal generic paramaters 'H'1,...'H'm, then ð
  727.   applied to any of the 'H'i (for 1<=i<=m) is 'Y'i and ð applied to any other
  728.   element is the element itself.
  729.  
  730. Then CT  conforms directly to BT  if and only if the Inheritance clause of
  731. C  lists B ['Z'1,...'Z'n] as one of its Parent items and, for every 'j'
  732. such that 1<='j'<='n', applying substitution ð to 'Z'j yields X j.
  733.  
  734.  
  735. VNCH, Chapter 13.8
  736.  
  737. Direct Conformance (Anchored)
  738.  
  739. In a class C, type like Current conforms directly to its base type CT, where CT
  740. is C followed by its Formal_generic_list, if any, with any Constraint removed.
  741. Type like  anchor, where anchor is a feature of C or a formal argument of a
  742. routine of C, conforms directly to the type of anchor in C.
  743. An anchored type conforms directly to no type other than implied by these
  744. rules. No types conforms directly to an anchored type.
  745.  
  746.  
  747. VNCN, Chapter 13.5
  748.  
  749. Let CT be a type of base class C, and BT be a type whose base class B is not
  750. generic. CT conforms directly to BT if and only if the Inheritance clause of C
  751. lists B in one or more of its Parents items.
  752.  
  753.  
  754. VNCS, Chapter 13.3
  755.  
  756. Signature Conformance
  757.  
  758. A signature t =(<B1,..,Bn>,<S>) conforms to a signature 's'=(<A1,..,An>,<R>)
  759. if and only if:
  760. . Each of the two sequence components of t  has the same number of
  761.   elements as the corresponding component of 's'.
  762. . Every type in each of the two sequence components of t  conforms to
  763.   the corresponding type in the corresponding component of 's'.
  764.  
  765.  
  766. VNCX, Chapter 13.9
  767.  
  768. Conformance (Expression)
  769.  
  770. An expression v of type VT conforms to an expression t of type TT if and only
  771. if they satisfy any one of the following four conditions:
  772. 1. VT conforms to TT.
  773. 2. VT is like t (t in this case must be an entity).
  774. 3. VT and TT are both of the form like x for the same x.
  775. 4. TT is like x where x is a formal argument to a routine r, v is an actual
  776.    argument in a call to r, and VT conforms to the type of the actual argument
  777.    corresponding to x in the call.
  778.  
  779.  
  780. VOMB, Chapter 14.5
  781.  
  782. Multi_branch rule
  783.  
  784. A Multi_branch instruction is valid if and only if the following conditions
  785. are met by its unfolded form:
  786. 1. The inspect expression is of type INTEGER  or CHARACTER .
  787. 2. The inspect constants (the values in the various Choices parts) are constant
  788.    attributes of the same type as the inspect expression.
  789. 3. Any two non-Unique inspect constants have different values.
  790. 4. Any two Unique inspect constants have different names.
  791. 5. If any inspect constant is Unique, then every other inpect constant in the
  792.    instruction is either Unique or has negative or zero value.
  793. 6. All Unique inspect constants, if any, have the same class of origin (the
  794.    enclosing class or a proper ancestor).
  795.  
  796.  
  797. VQMC, Chapter 16.5
  798.  
  799. A declaration of a feature f introducing a manifest constant is valid if and
  800. only if the Manifest_constant m  used in the declaration matches the type T
  801. declared for f in one of the following ways:
  802. . m is a Boolean_constant and T is BOOLEAN.
  803. . m is a Character_constant and T is CHARACTER.
  804. . m is an Integer_constant and T is INTEGER.
  805. . m is a Real_constant and T is REAL  or DOUBLE.
  806. . m is a Manifest_string and T is STRING.
  807. . m is a Bit_constant and T is a Bit_type.
  808.  
  809.  
  810. VQUI, Chapter 16.6
  811.  
  812. A declaration of a feature f introducing a Unique constant is valid if and only
  813. if the type T declared for f is INTEGER.
  814.  
  815.  
  816. VREG, Chapter 8.3
  817.  
  818. Let el be an Entity_declaration_list. Let identifiers be the concatenation of
  819. every Identifier_list of every Entity_declaration_group in fa. Then el is valid
  820. if and only if no Identifier appears more than once in the list identifiers.
  821.  
  822.  
  823. VRFA, Chapter 8.3
  824.  
  825. Formal Argument rule
  826.  
  827. Let fa be the Formal_arguments part of a routine r in a class C. Let formals be
  828. the concatenation of every Identifier_list of every Entity_declaration_group in
  829. fa. Then fa is valid if and only if no Identifier e appearing in formals is the
  830. final name of a feature of C.
  831.  
  832.  
  833. VRLE, Chapter 8.7
  834.  
  835. Local Entity rule
  836.  
  837. Let ld be the Local_declarations part of a routine r in a class C. Let locals
  838. be the concatenation of every Identifier_list of every Entity_declaration_group
  839. in ld. Then ld is valid if and only if every Identifier e in ld satisfies the
  840. following two conditions:
  841. 1. No feature of C has e as its final name.
  842. 2. No formal argument of r has e as its Identifier.
  843.  
  844.  
  845. VRRR, Chapter 8.5
  846.  
  847. Routine rule
  848.  
  849. A Routine part of a routine declaration is valid if and only if one of the
  850. following conditions holds:
  851. 1. Its Routine_body is an Internal body (beginning with do or once).
  852. 2. In the other cases (where the Routine_body is External or Deferred), there
  853.    is neither a Local_declarations part nor a Rescue part.
  854.  
  855.  
  856. VSCN, Chapter 3.5
  857.  
  858. No two classes in a given cluster may have the same class name.
  859.  
  860.  
  861. VSRC, Chapter 3.4
  862.  
  863. Root class rule
  864.  
  865. A class C  may be used as root of a system if and only if it satisfies the
  866. following two conditions:
  867. 1. C is not generic.
  868. 2. Any creation procedure of C has either no formal argument, or a single
  869.    formal argument of type ARRAY[STRING].
  870.  
  871.  
  872. VTAT, Chapter 12.15
  873.  
  874. An anchored type of the form like anchor  appearing in a class C is valid if
  875. and only if one of the following holds:
  876. 1. anchor  is the final name of an attribute or function of C, whose declared
  877.    type is a non-Anchored reference type.
  878. 2. The type appears in the text of a routine r of C, and anchor is a formal
  879.    argument of r, whose declared type is a non-Anchored reference type.
  880. 3. anchor  is the reserved word Current .
  881.  
  882.  
  883. VTBT, Chapter 12.14
  884.  
  885. A Bit_type is valid if and only if its Constant is of type INTEGER, and has a
  886. positive value.
  887.  
  888.  
  889. VTCG, Chapter 12.8
  890.  
  891. Constrained Genericity rule
  892.  
  893. Let C be a constrained generic class. A Class_type CT having C as base class is
  894. valid if and only if CT satisfies the Unconstrained Genericity rule and, in
  895. addition:
  896. 3. For any Formal_generic parameter in the declaration of C having a constraint
  897.    of the form -> D, the corresponding Type in the Actual_generics list of CT
  898.    conforms to D.
  899.  
  900.  
  901. VTCT, Chapter 12.5
  902.  
  903. Class Type rule
  904.  
  905. An Identifier CC is valid as the Class_name part of a Class_type if and only if
  906. it is the name of a class in the surrounding universe.
  907.  
  908.  
  909. VTEC, Chapter 12.12
  910.  
  911. Expanded Type rule
  912.  
  913. An expanded type of the form expanded  CT, where CT is a Class_type of base
  914. class C , is valid if and only if it satisfies the following conditions:
  915. 1. C is not a deferred class.
  916. 2. C either has no creation procedure, or has only one creation procedure with
  917.    no argument.
  918.  
  919.  
  920. VTUG, Chapter 12.7
  921.  
  922. Unconstrained Genericity rule
  923.  
  924. Let C be an unconstrained generic class. A Class_type CT having C as base class
  925. is valid if and only if it satisfies the following two conditions:
  926. 1. C is a generic class.
  927. 2. The number of Type components in CT's Actual_generics list is the same as
  928.    the number of Formal_generic parameters in the Formal_generic_list of C 's
  929.    declaration.
  930.  
  931.  
  932. VUAR, Chapter 22.9
  933.  
  934. Consider an E-valid (export-valid) call of target target  and feature name
  935. fname appearing in a class C. (For an Unqualified_call take target to be
  936. Current.) Let ST be the type of target, S the base class of ST, and sf the
  937. feature of final name fname in S. Let D be a descendant of S, and df the
  938. version of sf in D. The call is A-valid (argument-valid) for D if and only if
  939. it satisfies the following four conditions:
  940. 1. The number of actual arguments is the same as the number of formal arguments
  941.    declared for df .
  942. 2. Every actual argument, if any, conforms to the corresponding formal
  943.    argument of df .
  944. 3. If target  is itself a Call, it is (recursively) argument-valid for D .
  945. 4. If any of the actual arguments is of Address form $ 'fn', df  is an
  946.    external routine, and 'fn' is the final name of a feature of C  which is not
  947.    a constant attribute.
  948.  
  949.  
  950. VUCS, Chapter 22.9
  951.  
  952. Call rule
  953.  
  954. Consider a single-dot call with target x, appearing in a class C. Let S be the
  955. type of x. Then:
  956. 1. The call is C-valid (class-valid) if it is E-valid (export-valid) and
  957.    A-valid (argument-valid) for S .
  958. 2. The call is S-valid (system-valid) if for any element D  of the dynamic
  959.    class set of x  it is E-valid and A-valid for D .
  960.  
  961.  
  962. VUEX, Chapter 22.9
  963.  
  964. A call appearing in a class C, having fname as the feature of the call, is
  965. export-valid for a class D if and only if it satisfies either of the following
  966. two conditions:
  967. 1. The call is an Unqualified_call and fname is the final name of a feature of
  968.    C.
  969. 2. The call has at least one dot, D has a feature of name fname which is
  970.    available to C, and the call's target is either a valid entity of C or
  971.    (recursively) a call which is export-valid for D.
  972.  
  973.  
  974. VUGV, Chapter 22.9
  975.  
  976. Call rule
  977.  
  978. A call is valid if and only if it is both C-valid and S-valid.
  979.  
  980.  
  981. VWBE, Chapter 23.2
  982.  
  983. A Boolean_expression is valid if and only if it is an Expression of type
  984. BOOLEAN.
  985.  
  986.  
  987. VWEQ, Chapter 23.3
  988.  
  989. An Equality expression is valid if and only if either of its operand conforms
  990. to the other.
  991.  
  992.  
  993. VWCA, Chapter 23.13
  994.  
  995. A Constant_attribute in the text of a class C is valid if and only if its
  996. Entity is the final name of a constant attribute in C.
  997.  
  998.  
  999. VWID, Chapter 23.12
  1000.  
  1001. Identifier rule
  1002.  
  1003. An Identifier appearing unqualified in an expression as part of the text of a
  1004. routine r in a class C must be the name of a feature of C, a local entity of r,
  1005. or a formal argument of r.
  1006.  
  1007.  
  1008. VWMA, Chapter 23.20
  1009.  
  1010. Manifest Array rule
  1011.  
  1012. A Manifest_array <<e1, e2, ...en>> is a valid expression of type ARRAY[T]
  1013. if and only if the type of every ei conforms to T.
  1014.  
  1015.  
  1016. VWMS, Chapter 23.18
  1017.  
  1018. A Manifest_string is valid if and only if it satisfies the following two
  1019. conditions:
  1020. 1. None of the characters of its associated Simple_string is a double quote.
  1021. 2. In the extended form, no characters other than blanks or tabs may appear
  1022.    before the initial percent sign on the second and subsequent lines.
  1023.  
  1024.  
  1025. VWOE, Chapter 23.6
  1026.  
  1027. An Operator_expression is valid if and only if its equivalent dot form is a
  1028. valid call.
  1029.  
  1030.  
  1031. VWST, Chapter 23.21
  1032.  
  1033. A Strip expression appearing in a class C is valid if and only if every
  1034. Identifier in its Attribute_list is the final name of an attribute of C.
  1035.  
  1036.  
  1037. VXRC, Chapter 15.8
  1038.  
  1039. It is valid for a Routine to include a Rescue clause if and only if its
  1040. Routine_body is of the Internal form.
  1041.  
  1042.  
  1043. VXRT, Chapter 15.8
  1044.  
  1045. A Retry instruction is valid if and only if it appears in a Rescue clause.
  1046.  
  1047.  
  1048.